package com.study.lambda.basedemo;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2021/5/29 21:00
 */
public class LambdaDemo04
{
    public static void main1(String[] args)
    {
        List<String> names = Arrays.asList("张三", "里斯", "张五");
        List<String> list = names.stream().filter(s -> s.startsWith("张")).collect(Collectors.toList());
        for (String s : list)
        {
            System.out.println("s = " + s);
        }
    }

    public static void main(String[] args) {
        List<String> names = Arrays.asList("张三", "里斯", "张五");
        names.forEach(System.out::println);
    }
}
